#!/usr/bin/env node

//Transform 流对象中实现字符串的大写转换
const stdin=process.stdin,
      stdout=process.stdout,
      {Transform}=require('stream');
stdin.setEncoding('utf8');

let tf=new Transform();

tf._transform=function(chunk,encoding,callback){
  this.push(Buffer.from(chunk.toString("utf8").toUpperCase()));
  callback();
}
//将标准输入流管道接到转换流对象上再接到标准输出流上
stdin.pipe(tf).pipe(stdout);

